From: Keir Fraser Date: Fri, 7 Aug 2009 16:30:33 +0000 (+0100) Subject: x86: replace PAT initialisation magic value with a #define X-Git-Tag: archive/raspbian/4.8.0-1+rpi1~1^2~13502 X-Git-Url: https://dgit.raspbian.org/%22http://www.example.com/cgi/success//%22http:/www.example.com/cgi/success/?a=commitdiff_plain;h=bd53bc404fa4921c02b2154f132d812857603bf2;p=xen.git x86: replace PAT initialisation magic value with a #define Signed-off-by: Christoph Egger --- diff --git a/xen/arch/x86/hvm/svm/svm.c b/xen/arch/x86/hvm/svm/svm.c index 767803a7da..6236ead0be 100644 --- a/xen/arch/x86/hvm/svm/svm.c +++ b/xen/arch/x86/hvm/svm/svm.c @@ -266,7 +266,7 @@ static int svm_vmcb_restore(struct vcpu *v, struct hvm_hw_cpu *c) if ( paging_mode_hap(v->domain) ) { vmcb->np_enable = 1; - vmcb->g_pat = 0x0007040600070406ULL; /* guest PAT */ + vmcb->g_pat = MSR_IA32_CR_PAT_RESET; /* guest PAT */ vmcb->h_cr3 = pagetable_get_paddr(v->domain->arch.phys_table); } diff --git a/xen/arch/x86/hvm/svm/vmcb.c b/xen/arch/x86/hvm/svm/vmcb.c index d5f059aa6a..7366ecd22b 100644 --- a/xen/arch/x86/hvm/svm/vmcb.c +++ b/xen/arch/x86/hvm/svm/vmcb.c @@ -232,7 +232,7 @@ static int construct_vmcb(struct vcpu *v) if ( paging_mode_hap(v->domain) ) { vmcb->np_enable = 1; /* enable nested paging */ - vmcb->g_pat = 0x0007040600070406ULL; /* guest PAT */ + vmcb->g_pat = MSR_IA32_CR_PAT_RESET; /* guest PAT */ vmcb->h_cr3 = pagetable_get_paddr(v->domain->arch.phys_table); /* No point in intercepting CR3 reads/writes. */ diff --git a/xen/arch/x86/hvm/vmx/vmcs.c b/xen/arch/x86/hvm/vmx/vmcs.c index 47ce17e61b..e9daac5ecc 100644 --- a/xen/arch/x86/hvm/vmx/vmcs.c +++ b/xen/arch/x86/hvm/vmx/vmcs.c @@ -743,7 +743,7 @@ static int construct_vmcs(struct vcpu *v) u64 host_pat, guest_pat; rdmsrl(MSR_IA32_CR_PAT, host_pat); - guest_pat = 0x7040600070406ULL; + guest_pat = MSR_IA32_CR_PAT_RESET; __vmwrite(HOST_PAT, host_pat); __vmwrite(GUEST_PAT, guest_pat); diff --git a/xen/include/asm-x86/msr-index.h b/xen/include/asm-x86/msr-index.h index 2a2cfa6eac..aafcec821c 100644 --- a/xen/include/asm-x86/msr-index.h +++ b/xen/include/asm-x86/msr-index.h @@ -87,6 +87,7 @@ #define MSR_IA32_MTRR_PHYSMASK7 0x0000020f #define MSR_IA32_CR_PAT 0x00000277 +#define MSR_IA32_CR_PAT_RESET 0x0007040600070406ULL #define MSR_IA32_MC0_CTL 0x00000400 #define MSR_IA32_MC0_STATUS 0x00000401